# 文件异常与处理
import os.path

# t = open('')
t = None
try:
    # if not os.path.exists("test.txt"):
    t = open('test.txt', encoding='utf-8', mode='r+')

except Exception as e:
    print(e)
    print("报错了，哥哥")
else:
    t = open('test.txt', encoding='utf-8', mode='w')
    print("131313213213")
    t.write('hello world')
finally:
    t.close()
